﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLCMS.Business.DwzFrame;
using ZLCMS.Data.Model;
using ZLCMS.Business.Util;
using ZLCMS.Commands.User.Commands.Order;
using ZLCMS.Commands.Data;

namespace ZLCMS.Web.SystemManage.Basics.Shop.OrderReturns
{
    public partial class OrderReturnsDetail : System.Web.UI.Page
    {
        protected FrameHelper _framePage;
        protected ShopOrderReturns OrderReturnData;
        protected ShopOrderProduct OrderProduct;
        protected OrderData OrderDt;
        protected void Page_Load(object sender, EventArgs e)
        {
            //初始化DWZ控件
            _framePage = new FrameHelper(this);

            //加载订单信息
            LoadOrderReturnDetailResult result = new LoadOrderReturnDetailCommand().Execute(new LoadOrderReturnDetailParameter()
            {
                ReturnsId = Request["id"],
                UserAccount = UserKit.GetUserAccount()
            }).Result;

            OrderReturnData = result.Data;
            OrderDt = result.OrderDt;
            OrderProduct = result.OrderPorduct;
            logs.DataSource = result.Logs;
            logs.DataBind();
            
        }
        protected string GetImageHtml(string jsonString)
        {
            string imgHtml = "";
            foreach (var item in FileKit.FileList(jsonString))
            {
                imgHtml += string.Format("<a class='prettyPhoto' href='{0}'><img src='{0}' style='width:50px' /></a>&nbsp;", item.FilePath);
            }
            if (imgHtml=="")
            {
                imgHtml = "-";
            }
            return imgHtml;
        }
    }
}